package com.cwn.wizbank.utils.xml;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;

@XmlRootElement(name = "item")
public class CourseItem {
/*
*
	<tableofcontents identifier="TOC1" title="sdf">
        * <item identifier="ITEM1" title="这种">
            * <itemtype>FDR</itemtype>
            <item identifier="ITEM2" identifierref="6602" title="sdfds">
            * <itemtype>MOD</itemtype><restype>VOD</restype></item>
            <item identifier="ITEM3" identifierref="6605" title="76">
            * <itemtype>MOD</itemtype><restype>VOD</restype></item>
        * </item>
	* </tableofcontents>

* */
    @XmlAttribute
    public String identifier;

    @XmlAttribute(name = "identifierref", required = false)
    public String id; // id

    @XmlAttribute
    public String title;

    @XmlElement(name = "restype", required = false)
    public String restype;

    @XmlElement(name = "itemtype")
    public String itemtype;

    @XmlElement(name = "item")
    public List<CourseItem> item;

    public CourseItem() {
    }

    public CourseItem(String identifier, String id, String title, String restype, String itemtype, List<CourseItem> item) {
        this.identifier = identifier;
        this.id = id;
        this.title = title;
        this.restype = restype;
        this.itemtype = itemtype;
        this.item = item;
    }

    @Override
    public String toString() {
        return "CourseItem{" +
                "identifier='" + identifier + '\'' +
                ", id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", restype='" + restype + '\'' +
                ", itemtype='" + itemtype + '\'' +
                ", item=" + item +
                '}';
    }
}
